package com.starhub.api.auth.result;

import java.util.Date;

import lombok.Data;

@Data
public class AuthInfoResult {

    /**
     * 授权用户
     */
    private String authUser;
    /**
     * 授权码
     */
    private String authCode;
    /**
     * 授权到期时间
     */
    private String expireDate;
    /**
     * 用户数量
     */
    private int userCount;
    /**
     * 授权用户数量限制
     */
    private int userLimit;
    /**
     * 系统版本
     */
    private String systemVersion;
    /**
     * 授权描述
     */
    private String authDesc;
    private String message;
    private boolean success;
    
    public static AuthInfoResult fail(String message) {
        AuthInfoResult result = new AuthInfoResult();
        result.setSuccess(false);
        result.setMessage(message);
        return result;
    }

    public static AuthInfoResult success(String authUser, String authCode, String expireDate, int userCount, int userLimit, String systemVersion) {
        AuthInfoResult result = new AuthInfoResult();
        result.setAuthUser(authUser);
        result.setAuthCode(authCode);
        result.setExpireDate(expireDate);
        result.setUserCount(userCount);
        result.setUserLimit(userLimit);
        result.setSystemVersion(systemVersion);
        result.setSuccess(true);
        return result;
    }
}
